*Selling Out or Standing Firm? Explaining the Design of Civil War Peace Agreements Replication Files
use Selling_Out_or_Standing_Firm_processlevel.dta
  
**********************
**** MAIN RESULTS ****
**********************

*** Main DV ***

fracreg logit public_proportion2 ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimates store m1

fracreg logit public_proportion2 bes_sanctuary conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimates store m2

fracreg logit public_proportion2 e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimates store m3

*** Inclusive DV ***

fracreg logit public_proportion2_inc ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimates store m4

fracreg logit public_proportion2_inc bes_sanctuary conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimates store m5

fracreg logit public_proportion2_inc e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimates store m6

*********************
****** Table 1 ******
*********************

#delimit;
esttab m1 m2 m3 m4 m5 m6 using table1.rtf, replace
  modelwidth(7) se label nogaps nonotes title(Table 1: Fractional Logit Results) 
  addnote(Robust standard errors in parentheses. *p<0.10, **p<0.05, ***p<0.01.) 
  nonumbers mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6")  
  star(* 0.10 ** .05 *** .01) ;
#delimit cr

********************
***** Figure 2 *****
********************

qui fracreg logit public_proportion2 ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
margins, dydx(ethnic_all_dum)
margins, at(ethnic_all_dum=(0 1)) vsquish
marginsplot, recast(bar) recastci(rcap) ///
  ciopts(lw(medthick) color(black)) ///
  plotopts(barw(.5) color(gs10)) ///
  xmtick(-.5(.5)1.5) ///
  ylabel(0(.20).60) ///
  ytitle(Predicted Public Benefits Proportion) ///
  title(" ") ///
  graphregion(color(white)) ///
  saving (ethnic_ppgraph.gph, replace)

qui fracreg logit public_proportion2 bes_sanctuary conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
margins, dydx(bes_sanctuary)
margins, at(bes_sanctuary=(0 1)) vsquish
marginsplot, recast(bar) recastci(rcap) ///
  ciopts(lw(medthick) color(black)) ///
  plotopts(barw(.5) color(gs10)) ///
  xmtick(-.5(.5)1.5) ///
  ylabel(0(.20).60) ///
  ytitle(" ", size(small)) ///
  title(" ") ///
  graphregion(color(white)) ///
  saving (sanctuary_ppgraph.gph, replace)

qui fracreg logit public_proportion2 e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
margins, at(e_contraband_dum2_max_duringconf=(0 1)) vsquish
marginsplot, recast(bar) recastci(rcap) ///
  ciopts(lw(medthick) color(black)) ///
  plotopts(barw(.5) color(gs10)) ///
  xmtick(-.5(.5)1.5) ///
  ylabel(0(.20).60) ///
  title(" ") ///
  ytitle(" ", size(small)) ///
  graphregion(color(white)) ///
  saving (contraband_ppgraph.gph, replace)

* Combine all 3 graphs into one figure 
* Final Figure 2
#delimit;
graph combine ethnic_ppgraph.gph sanctuary_ppgraph.gph contraband_ppgraph.gph,
  col(3)
  subtitle("", size(medsmall))
  graphregion(color(white))
  note("Note: 95% Confidence Intervals reported.", size(small)) 
  ;
#delimit cr
graph export Figure2.eps

*********************
*** Heckman Model ***
*********************

clear 
use Selling_Out_or_Standing_Firm_dyadyearlevel_forheckman.dta

* Main DV 
heckman public_proportion2 ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , select(outcomenew = battle_deaths_log reb_number_dum conf_type_eth_y  total_un_log aes_troops_dum bes_troops_dum i.regime ethnic_all_dum_yearly wdigdppc_log count count2 count3 ) cluster(dyad_id)
estimate store m13
heckman public_proportion2 bes_sanctuary_max_dur conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , select(outcomenew = battle_deaths_log reb_number_dum conf_type_eth_y  total_un_log aes_troops_dum bes_troops_dum i.regime bes_sanctuary wdigdppc_log count count2 count3 ) cluster(dyad_id)
estimate store m14
heckman public_proportion2 e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , select(outcomenew = battle_deaths_log reb_number_dum conf_type_eth_y  total_un_log aes_troops_dum bes_troops_dum i.regime e_contraband_dum2 wdigdppc_log count count2 count3 ) cluster(dyad_id)
estimate store m15

*********************
****** Table 2 ******
*********************
#delimit;
esttab m13 m14 m15 using table2.rtf, replace
  modelwidth(7) se label nogaps nonotes title(Table 2: Heckman and Matching Results) 
  addnote(Robust standard errors in parentheses. *p<0.10, **p<0.05, ***p<0.01.) 
  nonumbers mtitles("Model 1" "Model 2" "Model 3")  
  star(* 0.10 ** .05 *** .01) ;
#delimit cr

*********************
****** Table 3 ******
*********************

clear
use Selling_Out_or_Standing_Firm_processlevel.dta

fracreg logit public_proportion2 ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional i.regime i.third_party_cat , vce(robust)
estimates store m7
fracreg logit public_proportion2 bes_sanctuary conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional i.regime i.third_party_cat, vce(robust)
estimates store m8
fracreg logit public_proportion2 e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional i.regime i.third_party_cat, vce(robust)
estimates store m9
fracreg logit public_proportion2_inc ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional i.regime i.third_party_cat , vce(robust)
estimates store m10
fracreg logit public_proportion2_inc bes_sanctuary conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional i.regime i.third_party_cat, vce(robust)
estimates store m11
fracreg logit public_proportion2_inc e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional i.regime i.third_party_cat, vce(robust)
estimates store m12

**** Table 3 ****
#delimit;
esttab m7 m8 m9 m10 m11 m12 using table3.rtf, replace
  modelwidth(7) se label nogaps nonotes title(Table 3: Additional Controls Results) 
  addnote(Robust standard errors in parentheses. *p<0.10, **p<0.05, ***p<0.01.) 
  nonumbers mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6")  
  star(* 0.10 ** .05 *** .01) ;
#delimit cr

***************************
*** Online Appendix *******
***************************
****************************************
*** Table A1: Descriptive Statistics ***
****************************************

eststo summstats: estpost summarize public_proportion2 public_proportion2_inc public_proportion3 public_proportion2_imp3 ///
  ethnic_all_dum bes_sanctuary e_contraband_dum2 source3 crime ///
  conf_type_eth conf_type_terronly rebstrength_cat intensity_dummy conventional osv_state_dum ///
  regime third_party_cat ethnic_all_comp_dumor bes_materiel_max_duringconf leader_proportion2 previouspeace_dummy days_norm
esttab summstats using descriptivestatistics.rtf, replace ///
  cell((count(label(Obs)) mean(label(Mean)) sd(label(SD)) min(label(Min)) max(label(Max)))) ///
  label nomtitle nonumber title(Table A1: Descriptive Statistics) 

******************************************************
****** Table 2A Heckman Model with Inclusive DV ******
******************************************************

clear 
use Selling_Out_or_Standing_Firm_dyadyearlevel_forheckman.dta

heckman public_proportion2_inc ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , select(outcomenew = battle_deaths_log reb_number_dum conf_type_eth_y  total_un_log aes_troops_dum bes_troops_dum i.regime ethnic_all_dum_yearly wdigdppc_log count count2 count3 ) cluster(dyad_id)
estimate store ms22
heckman public_proportion2_inc bes_sanctuary_max_dur conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , select(outcomenew = battle_deaths_log reb_number_dum conf_type_eth_y  total_un_log aes_troops_dum bes_troops_dum i.regime bes_sanctuary wdigdppc_log count count2 count3 ) cluster(dyad_id)
estimate store ms23
heckman public_proportion2_inc e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , select(outcomenew = battle_deaths_log reb_number_dum conf_type_eth_y  total_un_log aes_troops_dum bes_troops_dum i.regime e_contraband_dum2 wdigdppc_log count count2 count3 ) cluster(dyad_id)
estimate store ms24

#delimit;
esttab ms22 ms23 ms24 using table2A.rtf, replace
  modelwidth(7) se label nogaps nonotes title(Table A2: Heckman and Matching Results, Inclusive DV) 
  addnote(Robust standard errors in parentheses. *p<0.10, **p<0.05, ***p<0.01.) 
  nonumbers mtitles("Model 1" "Model 2" "Model 3")  
  star(* 0.10 ** .05 *** .01) ;
#delimit cr
  
***************************************************************************
*** Table A3: Alternative Specifications and Civilian Reliance Measures ***  
***************************************************************************  

clear
use Selling_Out_or_Standing_Firm_processlevel.dta

*** All three measures in a single model ***
fracreg logit public_proportion2 ethnic_all_dum bes_sanctuary e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimate store ms1

*** Drop Ethnic from Conflict Type ***
fracreg logit public_proportion2 ethnic_all_dum conf_type_terronly rebstrength_cat intensity_dummy osv_state_dum conventional  , vce(robust)
estimate store ms2
fracreg logit public_proportion2 bes_sanctuary conf_type_terronly rebstrength_cat intensity_dummy osv_state_dum conventional  , vce(robust)
estimate store ms3
fracreg logit public_proportion2 e_contraband_dum2_max_duringconf conf_type_terronly rebstrength_cat intensity_dummy osv_state_dum conventional  , vce(robust)
estimate store ms4

*** Alternative Proxies of Civilian Reliance ***
* Civilian Source 
fracreg logit public_proportion2 source3 conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimate store ms5
* Crime 
fracreg logit public_proportion2 crime conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimate store ms6

#delimit;
esttab ms1 ms2 ms3 ms4 ms5 ms6 using table3A.rtf, replace
  modelwidth(7) se label nogaps nonotes title(Table A4: Alternative Specifications and Civilian Reliance Measures) 
  addnote(Robust standard errors in parentheses. *p<0.10, **p<0.05, ***p<0.01. Results hold when using inclusive DV.) 
  nonumbers mtitles("Combined Model" "Alt. Conf. Type" "Alt. Conf. Type" "Alt. Conf. Type" "Alt. IV" "Alt. IV")  
  star(* 0.10 ** .05 *** .01) ;
#delimit cr
   
********************************************
*** Table A4: Alternative Measures of DV ***  
********************************************   
 
*** Alternative DV using total benefits to all actors as denominator ***
fracreg logit public_proportion3 ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimate store ms7
fracreg logit public_proportion3 bes_sanctuary conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimate store ms8
fracreg logit public_proportion3 e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimate store ms9
  
*** Important Provisions DV ***
fracreg logit public_proportion2_imp3 ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimate store ms10
fracreg logit public_proportion2_imp3 bes_sanctuary conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimate store ms11
fracreg logit public_proportion2_imp3 e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional , vce(robust)
estimate store ms12

#delimit;
esttab ms7 ms8 ms9 ms10 ms11 ms12 using table4A.rtf, replace
  modelwidth(7) se label nogaps nonotes title(Table A3: Alternative Dependent Variable Measures) 
  addnote(Robust standard errors in parentheses. *p<0.10, **p<0.05, ***p<0.01. Results hold when using inclusive DV.) 
  nonumbers mtitles("Public over All Benefits DV" "Public over All Benefits DV" "Public over All Benefits DV" "Important Provisions DV" "Important Provisions DV" "Important Provisions DV")  
  star(* 0.10 ** .05 *** .01) ;
#delimit cr
 
*************************************
*** Table A5: Additional Controls ***
*************************************

*** Ethnic Competition, External Funding, Leader Benefits ***

fracreg logit public_proportion2 ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional ethnic_all_comp_dumor bes_materiel_max_duringconf leader_proportion2, vce(robust)
estimates store ms13
fracreg logit public_proportion2 bes_sanctuary conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional ethnic_all_comp_dumor bes_materiel_max_duringconf leader_proportion2, vce(robust)
estimate store ms14
fracreg logit public_proportion2 e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional ethnic_all_comp_dumor bes_materiel_max_duringconf leader_proportion2, vce(robust)
estimates store ms15

*** Previous Peace Attempts, Length of Negotiations ***

fracreg logit public_proportion2 ethnic_all_dum conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional previouspeace_dummy days_norm , vce(robust)
estimates store ms16
fracreg logit public_proportion2 bes_sanctuary conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional previouspeace_dummy days_norm , vce(robust)
estimates store ms17
fracreg logit public_proportion2 e_contraband_dum2_max_duringconf conf_type_eth rebstrength_cat intensity_dummy osv_state_dum conventional previouspeace_dummy days_norm, vce(robust)
estimates store ms18

#delimit;
esttab ms13 ms14 ms15 ms16 ms17 ms18 using table5A.rtf, replace
  modelwidth(7) se label nogaps nonotes title(Table A5: Additional Control Variables) 
  addnote(Robust standard errors in parentheses. *p<0.10, **p<0.05, ***p<0.01. Results hold when using inclusive DV.) 
  nonumbers mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6")  
  star(* 0.10 ** .05 *** .01) ;
#delimit cr

  
*********************************
*** Table A6: OSV interaction ***
*********************************

fracreg logit public_proportion2 ethnic_all_dum##osv_total_high conf_type_eth rebstrength_cat intensity_dummy conventional , vce(robust)
estimate store ms19
fracreg logit public_proportion2 bes_sanctuary##osv_total_high conf_type_eth rebstrength_cat intensity_dummy conventional , vce(robust)
estimate store ms20
fracreg logit public_proportion2 e_contraband_dum2_max_duringconf##osv_total_high conf_type_eth rebstrength_cat intensity_dummy conventional , vce(robust)
estimate store ms21

#delimit;
esttab ms19 ms20 ms21 using table6A.rtf, replace
  modelwidth(7) se label nogaps nonotes title(Table A6: Government OSV Interaction) 
  addnote(Robust standard errors in parentheses. *p<0.10, **p<0.05, ***p<0.01. Results hold when using inclusive DV.) 
  nonumbers mtitles("Model 1" "Model 2" "Model 3")  
  star(* 0.10 ** .05 *** .01) ;
#delimit cr
  	